Skip to content

Conversation

@k-horvath-deltares
Copy link
Contributor

@k-horvath-deltares k-horvath-deltares commented Sep 10, 2025

This branch contains blocks that are used to model advective and dispersive salt transport. They are only used in simulation, together with salt_simulation_mixin from the rtc-tools-simulation package.

@k-horvath-deltares k-horvath-deltares marked this pull request as ready for review December 10, 2025 15:09
@jarsarasty jarsarasty requested a review from Copilot December 10, 2025 16:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces salt simulation capabilities to the RTC-Tools Channel Flow package by adding a new Salt package containing elements for modeling advective and dispersive salt transport in water systems. These components are designed to work with the salt_simulation_mixin from the rtc-tools-simulation package and are intended for simulation only, not optimization.

Key changes:

  • Added new Salt package with reservoir, node, and structure elements for salt transport modeling
  • Implemented UNESCO EOS-80 equation for seawater density calculations based on salinity and temperature
  • Created specialized forcing and storage elements supporting mass transport alongside volume flow

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
package.order (ChannelFlow) Registered new Salt package in module hierarchy
Salt/package.mo Root package definition for salt simulation components
Salt/package.order Declared Elements subpackage
Salt/Elements/package.mo Elements subpackage definition
Salt/Elements/package.order Listed all salt simulation element classes
SubstanceControlledStructure.mo Structure element implementing density-driven flow with UNESCO EOS-80 calculations
SaltyPartialStorage.mo Base class for storage elements with mass balance
SaltyPartialReservoirBnd.mo Boundary reservoir base class (zero derivatives)
SaltyPartialReservoir.mo Standard reservoir base class with mass and volume conservation
SaltyLinearReservoirBnd.mo Linear reservoir boundary implementation
SaltyLinearReservoir.mo Linear reservoir implementation with forcing
QMForcing.mo Forcing class for volume and mass flow inputs
NodeSalty.mo Node element connecting reservoirs with mass conservation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

model SubstanceControlledStructure "SubstanceControlledStructure"
/*
This block is designed to be used together with the "salt_simulation_mixin" to calculate dispersive and advective transport
between salty reservoir elements, do not user in optimization.
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'user' to 'use'.

Suggested change
between salty reservoir elements, do not user in optimization.
between salty reservoir elements, do not use in optimization.

Copilot uses AI. Check for mistakes.
partial model SaltyPartialStorage
/*
This block is designed to be used together with the "salt_simulation_mixin" to calculate dispersive and advective transport
between salty reservoir elements, do not user in optimization.
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'user' to 'use'.

Suggested change
between salty reservoir elements, do not user in optimization.
between salty reservoir elements, do not use in optimization.

Copilot uses AI. Check for mistakes.
model SaltyLinearReservoirBnd
/*
This block is designed to be used together with the "salt_simulation_mixin" to calculate dispersive and advective transport
between salty reservoir elements, do not user in optimization.
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'user' to 'use'.

Suggested change
between salty reservoir elements, do not user in optimization.
between salty reservoir elements, do not use in optimization.

Copilot uses AI. Check for mistakes.
model SaltyLinearReservoir
/*
This block is designed to be used together with the "salt_simulation_mixin" to calculate dispersive and advective transport
between salty reservoir elements, do not user in optimization.
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'user' to 'use'.

Suggested change
between salty reservoir elements, do not user in optimization.
between salty reservoir elements, do not use in optimization.

Copilot uses AI. Check for mistakes.
model NodeSalty
/*
This block is designed to be used together with the "salt_simulation_mixin" to calculate dispersive and advective transport
between salty reservoir elements, do not user in optimization.
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'user' to 'use'.

Suggested change
between salty reservoir elements, do not user in optimization.
between salty reservoir elements, do not use in optimization.

Copilot uses AI. Check for mistakes.
parameter Integer n_QForcing(min = 0) = 0;
replaceable package medium = Deltares.ChannelFlow.Media.FreshWater;
input SI.VolumeFlowRate QForcing[n_QForcing];
input SI.VolumeFlowRate MForcing[n_QForcing];
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable MForcing represents mass flow rate but is typed as VolumeFlowRate. Consider using SI.MassFlowRate for MForcing to accurately reflect the physical quantity.

Suggested change
input SI.VolumeFlowRate MForcing[n_QForcing];
input SI.MassFlowRate MForcing[n_QForcing];

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants